Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Stream for IAR toolchain #9033

Merged
merged 3 commits into from
Dec 11, 2018
Merged

Fix Stream for IAR toolchain #9033

merged 3 commits into from
Dec 11, 2018

Conversation

fkjagodzinski
Copy link
Member

Description

This is a follow-up to PR #8331; fixing the Stream methods not covered there. I also added a few more test cases to cover all of affected methods.

The workaround removed in #8331 was introduced in #770.

CC @deepikabhavnani @kjbracey-arm

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

This is a follow-up to PR ARMmbed#8331; fixing the Stream methods not covered
there.
Copy link
Contributor

@kjbracey kjbracey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main code change seems fine.

* A qute from `man 3 fdopen`:
*
* Reads and writes may be intermixed on read/write streams in any order. Note
* that ANSI C requires that a file positioning function intervene between
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still don't like this man page text, as it's paraphrasing what the standard actually says, inaccurately.

If you're going to put anything in, make it the standard text. From C99:

When a file is opened with update mode ('+' as the second or third character in the
above list of mode argument values), both input and output may be performed on the
associated stream. However, output shall not be directly followed by input without an
intervening call to the fflush function or to a file positioning function (fseek,
fsetpos, or rewind), and input shall not be directly followed by output without an
intervening call to a file positioning function, unless the input operation encounters end-of-
file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the spec quote as suggested.

Use C99 instead of Linux man entry.
Copy link

@deepikabhavnani deepikabhavnani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@cmonr
Copy link
Contributor

cmonr commented Dec 10, 2018

CI started

@mbed-ci
Copy link

mbed-ci commented Dec 10, 2018

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@cmonr cmonr merged commit 8952760 into ARMmbed:master Dec 11, 2018
@fkjagodzinski fkjagodzinski deleted the fix-stream branch December 21, 2018 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants